From 3a54f724912d4ed976d3be1a8c549918a5ef5245 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Wed, 1 Mar 2017 18:22:31 +0000 Subject: [PATCH] tools/fuzz: Include LLVMFuzzerTestOneInput() in the generated .a Otherwise they are not suitable for use with libfuzz. Signed-off-by: Andrew Cooper Reviewed-by: Wei Liu --- tools/fuzz/libelf/Makefile | 2 +- tools/fuzz/x86_instruction_emulator/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/fuzz/libelf/Makefile b/tools/fuzz/libelf/Makefile index c884703ff0..6cdc31eeb5 100644 --- a/tools/fuzz/libelf/Makefile +++ b/tools/fuzz/libelf/Makefile @@ -13,7 +13,7 @@ $(ELF_LIB_OBJS): CFLAGS += -DFUZZ_NO_LIBXC $(CFLAGS_xeninclude) libelf-fuzzer.o: CFLAGS += $(CFLAGS_xeninclude) -libelf.a: $(ELF_LIB_OBJS) +libelf.a: libelf-fuzzer.o $(ELF_LIB_OBJS) $(AR) rc $@ $^ .PHONY: libelf-fuzzer-all diff --git a/tools/fuzz/x86_instruction_emulator/Makefile b/tools/fuzz/x86_instruction_emulator/Makefile index 673b5f042d..abba186bcc 100644 --- a/tools/fuzz/x86_instruction_emulator/Makefile +++ b/tools/fuzz/x86_instruction_emulator/Makefile @@ -30,7 +30,7 @@ x86_emulate.o: x86_emulate.c x86_emulate/x86_emulate.c $(x86_emulate.h) x86-insn-emulator-fuzzer.o: $(x86_emulate.h) -x86-insn-emulator.a: x86_emulate.o +x86-insn-emulator.a: x86-insn-emulator-fuzzer.o x86_emulate.o $(AR) rc $@ $^ afl-x86-insn-emulator-fuzzer: afl-x86-insn-emulator-fuzzer.o x86-insn-emulator-fuzzer.o x86_emulate.o -- 2.30.2